import { useUserStore } from '../stores/user'
import request from '../utils/request'
import type { BaseResponse } from '../types/api-response'
import type { CategoryItem } from '../types/category'

// 获取分类列表
export const getCategoryList = () => {
  const userStore = useUserStore()
  console.log(userStore.token)
  return request<BaseResponse<CategoryItem[]>>({
    url: '/category/list',
    method: 'GET',
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      'token': `${userStore.token}`
    }
  })
}
